import { Entity, Column, Index } from 'typeorm';
import { BaseEntity } from '../../base/entity/base';

@Entity('provider_customer', { comment: '服务人员客户管理' })
export class ProviderCustomerEntity extends BaseEntity {
    @Index()
    @Column({ comment: '归属团队ID', type: 'int', nullable: false })
    teamId: number;

    @Index()
    @Column({ comment: '用户ID', type: 'int', nullable: true })
    userId?: number;

    @Column({ comment: '客户名称', length: 50, nullable: true })
    name: string;

    @Column({ comment: '联系电话', length: 20, nullable: true })
    phone: string;

    @Column({ comment: '备注', nullable: true })
    remark: string;

    @Column({ comment: '岗位/职位', length: 50, nullable: true })
    position: string;

    @Column({ comment: '是否标记为重要客户', default: false })
    isStar: boolean;

    @Column({ comment: '状态 0:禁用 1:正常', type: 'tinyint', default: 1 })
    status: number;

    @Column({ comment: '最后跟进时间', nullable: true })
    lastFollowTime: Date;
}

